package com.tuling.code.transaction;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.tuling.code.model.User;
import com.tuling.code.transaction.service.UserService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring-transacation/applicationContext*.xml")
public class TransactionTeser{
	@Resource
	private UserService service;
	
	@Test
	public void testInsert(){
		User u = new User();
		u.setName("test");
		u.setAddress("湖南省长沙市岳麓区");
		u.setPhone("15109890091");
		service.insert(u);
	}
	
	@Test
	public void testChild(){
		service.child();
	}
	
	@Test
	public void testParent(){
		service.parent();
	}
	
	@Test
	public void testParent2(){
		service.parent2();
	}
}
